import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BicycleCostVO, BicycleCostForm, BicycleCostQuery } from '@/api/business/bicycleCost/types';

/**
 * 查询车库物业费列表
 * @param query
 * @returns {*}
 */

export const listBicycleCost = (query?: BicycleCostQuery): AxiosPromise<BicycleCostVO[]> => {
  return request({
    url: '/business/bicycleCost/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询车库物业费详细
 * @param bicycleCostId
 */
export const getBicycleCost = (bicycleCostId: string | number): AxiosPromise<BicycleCostVO> => {
  return request({
    url: '/business/bicycleCost/' + bicycleCostId,
    method: 'get'
  });
};

/**
 * 新增车库物业费
 * @param data
 */
export const addBicycleCost = (data: BicycleCostForm) => {
  return request({
    url: '/business/bicycleCost',
    method: 'post',
    data: data
  });
};

/**
 * 修改车库物业费
 * @param data
 */
export const updateBicycleCost = (data: BicycleCostForm) => {
  return request({
    url: '/business/bicycleCost',
    method: 'put',
    data: data
  });
};

/**
 * 删除车库物业费
 * @param bicycleCostId
 */
export const delBicycleCost = (bicycleCostId: string | number | Array<string | number>) => {
  return request({
    url: '/business/bicycleCost/' + bicycleCostId,
    method: 'delete'
  });
};
